package com.koolearn.android.kooreader.popup;

import com.koolearn.android.kooreader.KooAndroidAction;
import com.koolearn.android.kooreader.KooReader;
import com.koolearn.klibrary.text.model.ZLTextModel;
import com.koolearn.klibrary.text.view.ZLTextView;
import com.koolearn.kooreader.kooreader.KooReaderApp;

/**
 * Created by Administrator on 2016/8/23.
 */
public class ShowProgressAction extends KooAndroidAction {
    ShowProgressAction(KooReader baseActivity, KooReaderApp kooreader) {
        super(baseActivity, kooreader);
    }

    @Override
    public boolean isVisible() {
        final ZLTextView view = (ZLTextView)Reader.getCurrentView();
        final ZLTextModel textModel = view.getModel();
        return textModel != null && textModel.getParagraphsNumber() != 0;
    }
    @Override
    protected void run(Object... params) {
        BaseActivity.progress();
    }
}
